Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Let Address#build_default accept args and block #3429

Merged
merged 1 commit into from
Nov 20, 2019

Conversation

elia
Copy link
Member

@elia elia commented Nov 15, 2019

Description

Let Address#build_default it delegate to build/new and leverage scopes for default
attributes. This stems from refactoring code that looked like this:

Spree::Address.build_default.tap do |address|
  address.first_name = "Ryan"
end

With this change it will look like this:

Spree::Address.build_default(first_name: "Ryan")

or

Spree::Address.build_default do |address|
  address.first_name = "Ryan"
end

Checklist:

  • I have followed Pull Request guidelines
  • I have added a detailed description into each commit message
  • I have updated Guides and README accordingly to this change (if needed)
  • I have added tests to cover this change (if needed)

Let it delegate to build/new and leverage scopes for default
attributes.
@elia elia force-pushed the elia/address-build-default-args branch from 69b02f7 to a07fee1 Compare November 15, 2019 14:27
Copy link
Member

@tvdeyen tvdeyen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks.

Copy link
Member

@kennyadsl kennyadsl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @elia!

@kennyadsl kennyadsl merged commit 6f182fb into solidusio:master Nov 20, 2019
@kennyadsl kennyadsl deleted the elia/address-build-default-args branch November 20, 2019 10:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants